package org.surelink.radius.console.message;

public class Response {

    private int code;

    private String msg;

    private Object result;


    public Response() {
    }

    public Response(int errcode, String errmsg) {
        this.code = errcode;
        this.msg = errmsg;
    }

    public Response(Object result) {
        setCode(RespBase.SUCCESS.getCode());
        setMsg(RespBase.SUCCESS.getMsg());
        this.result = result;
    }

    public Response(Response base) {
        setCode(base.getCode());
        setMsg(base.getMsg());
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }


    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Response{");
        sb.append("code=").append(code);
        sb.append(", msg='").append(msg).append('\'');
        sb.append(", result=").append(result);
        sb.append('}');
        return sb.toString();
    }
}
